<?php
/**
 * Created by PhpStorm.
 * User: wangye
 * Date: 19-3-4
 * Time: 上午10:50
 */

$str = [1,3,2,4,6,5];

for ($i=0;$i<count($str);$i++) {
    for ($j=0;$j<count($str);$j++) {
        if ($str[$i]<$str[$j]) {
            $s = $str[$i];
            $str[$i] = $str[$j];
            $str[$j] = $s;
        }
    }
//    echo $str[$i];
}
print_r($str);